﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using SmartPhone.Un.Pro.Web.Models;
using SmartPhone.Un.Pro.BusinessLogic.Product;
using  SmartPhone.Un.Pro.DataContracts;

namespace SmartPhone.Un.Pro.Web.Controllers
{
    public class BaseController : Controller
    {
        #region userInfo
        private AccountInfo _userInfo;

        public AccountInfo UserInfo { 
            get
            {
                if (_userInfo == null)
                {
                    _userInfo = new AccountInfo();
                }

                _userInfo.UserID = _userInfo.UserID.GetGuid();
                _userInfo.UserName = _userInfo.UserName.GetString();
                _userInfo.Password = _userInfo.Password.GetString();                
                return _userInfo;
            }  
            set
            {
                if (_userInfo != value)
                {
                    _userInfo = value;
                }
            }
        
        }
        #endregion

    }
}

